<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>

        const pp1 = new Promise((resolve, reject) => {
            setTimeout(() => {
                const n = parseInt(Math.random() * 100);
                if (n % 2 === 0) {
                    resolve(n + '第一次成功');
                } else {
                    reject(n + '第一次失败');
                }
            }, 100)
        })

        const pp2 = new Promise((resolve, reject) => {
            setTimeout(() => {
                const n = parseInt(Math.random() * 100);
                if (n % 2 === 0) {
                    resolve(n + '第二次成功');
                } else {
                    reject(n + '第二次失败');
                }
            })
        })

        const pp3 = new Promise((resolve, reject) => {
            setTimeout(() => {
                const n = parseInt(Math.random() * 100);
                if (n % 2 === 0) {
                    resolve(n + '第三次成功');
                } else {
                    reject(n + '第三次失败');
                }
            })
        })

        // 返回所有的实例的结果，得到一个数组对象   status 状态   value 成功的结果   reason 失败的结果
        const pp = Promise.allSettled([pp1,pp2,pp3]) ;
        
        pp.then(res => {
            console.log(res);
        })

    </script>

</body>

</html>